//
//  ViewController.m
//  07-BanTang
//
//  Created by Snow on 16/7/23.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "ViewController.h"
#import "FirstViewController.h"
#import "SecondViewController.h"
#import "ThirdViewController.h"
#import "ForthViewController.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImageView *image = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"6"]];
    image.frame = CGRectMake(80, 100, 215, 360);
    [self.view addSubview:image];
    /**
     *2.隐藏tabBar, 按照<半糖>的tabBar样式自定义tabBar(自定义View)并实现点击效果
     3.每周一博(写一篇博客, 要求格式优于上周)
     4.预习tableView, 下周着重讲
     */
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, HEIGHT - 50, WIDTH / 5, 50)];
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = view.frame;
//    [button setTintColor:[UIColor lightGrayColor]];
    [button setImage:[UIImage imageNamed:@"1"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(handleButton:) forControlEvents:UIControlEventTouchUpInside];
    [view addSubview:button];
    [self.view addSubview:button];
    
    UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(WIDTH / 5, HEIGHT - 50, WIDTH / 5, 50)];
    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeSystem];
    button1.frame = view1.frame;
    [button1 setTintColor:[UIColor lightGrayColor]];
    [button1 setImage:[UIImage imageNamed:@"2"] forState:UIControlStateNormal];
    [button1 addTarget:self action:@selector(handleButton1:) forControlEvents:UIControlEventTouchUpInside];
    [view1 addSubview:button1];
    [self.view addSubview:button1];
    
    UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(WIDTH / 5 * 2, HEIGHT - 50, WIDTH / 5, 50)];
    UIButton *button2 = [UIButton buttonWithType:UIButtonTypeSystem];
    button2.frame = view2.frame;
    [button2 setTintColor:[UIColor lightGrayColor]];
    [button2 setImage:[UIImage imageNamed:@"3"] forState:UIControlStateNormal];
    [button2 addTarget:self action:@selector(handleButton2:) forControlEvents:UIControlEventTouchUpInside];
    [view2 addSubview:button2];
    [self.view addSubview:button2];
    
    UIView *view3 = [[UIView alloc] initWithFrame:CGRectMake(WIDTH / 5 * 3, HEIGHT - 50, WIDTH / 5, 50)];
    UIButton *button3 = [UIButton buttonWithType:UIButtonTypeSystem];
    button3.frame = view3.frame;
    [button3 setTintColor:[UIColor lightGrayColor]];
    [button3 setImage:[UIImage imageNamed:@"4"] forState:UIControlStateNormal];
    [button3 addTarget:self action:@selector(handleButton3:) forControlEvents:UIControlEventTouchUpInside];
    [view3 addSubview:button3];
    [self.view addSubview:button3];
    
    UIView *view4 = [[UIView alloc] initWithFrame:CGRectMake(WIDTH / 5 * 4, HEIGHT - 50, WIDTH / 5, 50)];
    UIButton *button4 = [UIButton buttonWithType:UIButtonTypeSystem];
    button4.frame = view4.frame;
    [button4 setTintColor:[UIColor lightGrayColor]];
    [button4 setImage:[UIImage imageNamed:@"5"] forState:UIControlStateNormal];
    [button4 addTarget:self action:@selector(handleButton4:) forControlEvents:UIControlEventTouchUpInside];
    [view4 addSubview:button4];
    [self.view addSubview:button4];
    
}
- (void)handleButton:(UIButton *)button
{}
- (void)handleButton1:(UIButton *)button
{
    FirstViewController *first = [[FirstViewController alloc] init];
    [self presentViewController:first animated:NO completion:nil];
}
- (void)handleButton2:(UIButton *)button
{
    SecondViewController *second = [[SecondViewController alloc] init];
    [self presentViewController:second animated:NO completion:nil];
}
- (void)handleButton3:(UIButton *)button
{
    ThirdViewController *third = [[ThirdViewController alloc] init];
    [self presentViewController:third animated:NO completion:nil];
}
- (void)handleButton4:(UIButton *)button
{
    ForthViewController *forth = [[ForthViewController alloc] init];
    [self presentViewController:forth animated:NO completion:nil];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
